# frozen_string_literal: true
json.array! @users do |user|
  json.extract! user, :name,:telephone,:id_card,:floor_code,:car_code,:state,:address
  json.avatar user.avatar.url
  json.building do
    json.extract! user.building, :code  if user.building
  end
  json.village do
    json.extract! @village ,:name ,:address
  end
  json.floor do
    json.array! @floors do |floor|
      json.extract! floor,:name,:telephone
    end
  end
  json.estate do
    json.array! @estates do |estate|
      json.extract! estate,:name,:telephone
    end
  end
end
